﻿<%@ Page Title="Datos del Cliente" Language="C#" MasterPageFile="~/MasterPage/Master.Master" AutoEventWireup="true" CodeBehind="wFrmCliente.aspx.cs" Inherits="Crosland.Automotriz.Web.wFrmCliente" UICulture="es" Culture="es-PE" %>

<%@ Register assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>
<%@ Register assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dx" %>

<%@ Register assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="server">
     <script type="text/javascript">

         function MostrarAlerta() {
             popupErrores.Show();
         }

</script>

    <script type="text/javascript">

        function pageLoad() {

            var control = document.getElementById('ctl00_cphMain_hfIndicador2');
            cambiarImagenHeader();

            if (control.value == 'S') {
                $find('<%= ((AjaxControlToolkit.CollapsiblePanelExtender)this.Master.FindControl("cpeMenuGeneral")).BehaviorID %>')._doClose();

                control.value = 'N';
            }
        }

</script>


<style type="text/css">

            /*Textbox Watermark*/

            .unwatermarked {
	            height:18px;
	            width:148px;
            }

            .watermarked {
	            height:20px;
	            width:150px;
	            padding:2px 0 0 2px;
	            /*border:1px solid #BEBEBE;*/
	            /*background-color:#F0F8FF;*/
	            color:gray;
            }
            </style>


                  <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always" >
    <ContentTemplate>
    
        <asp:UpdateProgress ID="UpdateProgress1" runat="server" 
            AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="0">
        <ProgressTemplate>
        <div style="padding: 10px; border: 1px solid #C0C0C0; position: absolute; top: 231px; left: 652px; background-color: #FFFFFF; color: #000000; width: 200px; height: 50px; text-align: center;">
            <img src="../Images/loading2.gif" style="vertical-align: middle; margin-right: 10px;" />
            <asp:Label ID="feedback" Text="Por favor espere..." runat="server" 
                ForeColor="#333333" Font-Bold="True" Font-Names="Verdana"></asp:Label>
                </div>
        </ProgressTemplate>
        </asp:UpdateProgress>
    


          <div class="main-header" style="width:100%;">
            <div class="main-titulo" style="text-align: left">Listado de Clientes</div>
          </div> 
          <asp:HiddenField ID="hfIndicador2" runat="server" Value="S" />
        <div style="padding: 15px">
                        
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td>
                <table>
                    <tr>
                        <td width="105">
                            <dx:ASPxButton ID="btnNuevo" runat="server" 
                                CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                                CssPostfix="Office2010Blue" onclick="btnNuevo_Click" 
                                SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Text="Nuevo" 
                                Width="100px">
                                <Image Url="~/Images/bt_new_button.gif">
                                </Image>
                            </dx:ASPxButton>
                        </td>
                        <td width="105">
                            <dx:ASPxButton ID="btnEditar" runat="server" 
                                CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                                CssPostfix="Office2010Blue" onclick="btnEditar_Click" 
                                SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Text="Editar" 
                                Width="100px">
                                <Image Url="~/Images/edit.gif">
                                </Image>
                            </dx:ASPxButton>
                        </td>
                        <td width="135px">
                            <dx:ASPxButton ID="btnSalir" runat="server" 
                                CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                                CssPostfix="Office2010Blue" onclick="btnSalir_Click" 
                                SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" 
                                Text="Salir" Width="100px">
                                <Image Url="~/Images/logout.png">
                                </Image>
                            </dx:ASPxButton>
                        </td>
                        <td width="175px">
                            &nbsp;</td>
                        <td width="163px">
                            &nbsp;</td>
                        <td width="163px">
                            &nbsp;</td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                <table width="100%" align="left" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td valign="top" align="left" style="padding-right: 5px" width="503">
            <dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" Width="630px" 
            CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
            CssPostfix="Office2010Blue" EnableDefaultAppearance="False" 
            GroupBoxCaptionOffsetX="6px" GroupBoxCaptionOffsetY="-19px" HeaderText="Buscar Cliente" 
            SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Height="82px">

                  <ContentPaddings PaddingBottom="10px" PaddingLeft="9px" PaddingRight="11px" 
                      PaddingTop="10px" />
<ContentPaddings PaddingLeft="9px" PaddingTop="10px" PaddingRight="11px" PaddingBottom="10px"></ContentPaddings>

                  <HeaderStyle>
                  <Paddings PaddingBottom="6px" PaddingLeft="9px" PaddingRight="11px" 
                      PaddingTop="3px" />
<Paddings PaddingLeft="9px" PaddingTop="3px" PaddingRight="11px" PaddingBottom="6px"></Paddings>
                  </HeaderStyle>

                  <PanelCollection>
<dx:PanelContent ID="PanelContent3" runat="server" SupportsDisabledAttribute="True">
               <table width="100%">
               
               <tr>
                            <td style="width: 53px" valign="middle" class="formato-tabla-td">
                                &nbsp;<asp:Label ID="Label1" runat="server" 
                                    Text="Buscar:" BorderStyle="None"></asp:Label>
                            </td>
                            <td style="width: 275px">
                                <dx:ASPxTextBox ID="txtDescripcion" runat="server" Height="30px" Width="270px" 
                                    CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                                    CssPostfix="Office2010Blue" 
                                    SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" 
                                    MaxLength="100" NullText="NOMBRE COMERCIAL O RUC">
                                    <Paddings PaddingLeft="5px" />
                                    <NullTextStyle CssClass="watermarked">
                                    </NullTextStyle>
<ValidationSettings>
<RegularExpression ErrorText="Fall&#243; la validaci&#243;n de expresi&#243;n Regular"></RegularExpression>
</ValidationSettings>
                                </dx:ASPxTextBox>
                            </td>
                            <td width="70">
                                <dx:ASPxComboBox ID="cboOpcion" runat="server" AllowMouseWheel="False" 
                                    CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                                    CssPostfix="Office2010Blue" EnableAnimation="False" 
                                    EnableDefaultAppearance="False" Height="30px" SelectedIndex="0" 
                                    ShowLoadingPanel="False" ShowLoadingPanelImage="False" ShowShadow="False" 
                                    Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" 
                                    Width="60px">
                                    <Items>
                                        <dx:ListEditItem Selected="True" Text="100" Value="100" />
                                        <dx:ListEditItem Text="200" Value="200" />
                                        <dx:ListEditItem Text="500" Value="500" />
                                        <dx:ListEditItem Text="1000" Value="1000" />
                                    </Items>
                                    <ItemStyle Height="30px" />
                                    <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                                    </LoadingPanelImage>
                                    <LoadingPanelStyle ImageSpacing="5px">
                                    </LoadingPanelStyle>
                                    <DropDownButton Width="20px">
                                    </DropDownButton>
                                    <ButtonStyle Width="13px">
                                    </ButtonStyle>
                                    <Paddings PaddingLeft="5px" />
                                    <ValidationSettings>
                                        <RegularExpression ErrorText="Falló la validación de expresión Regular" />
                                    </ValidationSettings>
                                </dx:ASPxComboBox>
                            </td>
                            <td style="width: 69px">
                                <asp:Label ID="Label2" runat="server" Text="registros"></asp:Label>
                            </td>
                            <td>
                                <dx:ASPxButton ID="btnConsultar" runat="server" 
                                    CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                                    CssPostfix="Office2010Blue" OnClick="btnConsultar_Click" 
                                    SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Text="Consultar" 
                                    Width="100px">
                                    <Image Url="~/Images/search.png">
                                    </Image>
                                </dx:ASPxButton>
                            </td>

                            
                        </tr>

               
               </table>


               
               
                </dx:PanelContent>
</PanelCollection>


                  </dx:ASPxRoundPanel>
                        </td>
                        <td align="left" valign="top">
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td align="left" style="padding-right: 5px" valign="top" width="503">
                            &nbsp;</td>
                        <td align="left" valign="top">
                            &nbsp;</td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td height="10">
            <div style="display:none">
                <dx:ASPxTextBox ID="txtIdVendedor" runat="server" 
                    ClientInstanceName="txtIdVendedor" Height="20px" ReadOnly="True" Width="100px" >
                    <ValidationSettings ErrorText="Valor inválido">
                        <RegularExpression ErrorText="Falló la validación de expresión Regular" />
                    </ValidationSettings>
                </dx:ASPxTextBox>
                </div>
                <dx:ASPxGridView ID="grdClientes" runat="server" AutoGenerateColumns="False" 
                    CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                    CssPostfix="Office2010Blue" KeyFieldName="ID_CLIENTE" 
                    onpageindexchanged="grdClientes_PageIndexChanged" Width="100%" 
                    style="margin-top: 0px">
                    <Columns>
                        <dx:GridViewDataTextColumn Caption="Razón Social" 
                            FieldName="DES_CLIENTE" VisibleIndex="3">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="ID" FieldName="ID_CLIENTE" VisibleIndex="0" 
                            Width="50px">
                            <HeaderStyle HorizontalAlign="Center" />
                            <CellStyle HorizontalAlign="Center">
                            </CellStyle>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Nombre Comercial" FieldName="NOM_COMERCIAL" 
                            VisibleIndex="2">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="RUC" FieldName="NIF" VisibleIndex="4">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Departamento" FieldName="Departamento" 
                            VisibleIndex="5">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Provincia" FieldName="Provincia" 
                            VisibleIndex="6">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Distrito" FieldName="Distrito" 
                            VisibleIndex="7">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Dirección" FieldName="DES_DIRECCION" 
                            VisibleIndex="9">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="IND_SAP" FieldName="IND_SAP" 
                            VisibleIndex="8" Width="0px" Visible="False">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Código" FieldName="COD_CLIENTE" 
                            VisibleIndex="1">
                        </dx:GridViewDataTextColumn>
                    </Columns>
                    <SettingsBehavior AllowFocusedRow="True" AllowSelectByRowClick="True" 
                        AllowSelectSingleRowOnly="True" AllowDragDrop="False" AllowGroup="False" 
                        AllowSort="False" />
                    <SettingsPager NumericButtonCount="15" PageSize="15">
                    </SettingsPager>
                    <Settings ShowGroupButtons="False" />
                    <Images SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                        <LoadingPanelOnStatusBar Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                        </LoadingPanelOnStatusBar>
                        <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                        </LoadingPanel>
                    </Images>
                    <ImagesFilterControl>
                        <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                        </LoadingPanel>
                    </ImagesFilterControl>
                    <Styles CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                        CssPostfix="Office2010Blue">
                        <Header ImageSpacing="5px" SortingImageSpacing="5px">
                        </Header>
                        <LoadingPanel ImageSpacing="5px">
                        </LoadingPanel>
                    </Styles>
                    <StylesPager>
                        <PageNumber ForeColor="#3E4846">
                        </PageNumber>
                        <Summary ForeColor="#1E395B">
                        </Summary>
                    </StylesPager>
                    <StylesEditors ButtonEditCellSpacing="0">
                        <ProgressBar Height="21px">
                        </ProgressBar>
                    </StylesEditors>
                </dx:ASPxGridView>
            </td>
        </tr>
    </table>



    </div>
    <dx:ASPxPopupControl ID="popupErrores" runat="server" AllowDragging="True" 
                    ClientInstanceName="popupErrores" CloseAction="CloseButton" 
                    CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue" 
                    EnableViewState="False" HeaderText="Mensaje" Modal="True" 
                    PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" 
                    SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" 
              Width="300px" EnableHotTrack="False">
                
                    <HeaderImage Url="~/Images/icon_message.png">
                    </HeaderImage>
                
                    <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Web/Loading.gif">
                    </LoadingPanelImage>
                    <HeaderStyle>
                    <Paddings PaddingLeft="7px" />
                    </HeaderStyle>
                
                    <LoadingPanelStyle ImageSpacing="5px">
                    </LoadingPanelStyle>
                
                 <ContentCollection>
<dx:PopupControlContentControl ID="PopupControlContentControl2" runat="server" SupportsDisabledAttribute="True">

    <br />
      <dx:ASPxPanel ID="ASPxPanel3" runat="server" DefaultButton="btCreate">
                    <PanelCollection>
                        <dx:PanelContent ID="PanelContent2" runat="server">
                        <table width="100%">
                        <tr>
                        <td align="center" valign="middle">
                        
                        
                        
                            <asp:Label ID="lblMensaje" runat="server"></asp:Label>
                            <br /> &nbsp;</td>
                        
                        </tr>
                        <tr>
                        <td align="center">
                        
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
                        
                            <dx:ASPxButton ID="ASPxButton6" runat="server" AutoPostBack="False" 
                                CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                                CssPostfix="Office2010Blue" 
                                SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Text="Aceptar" 
                                Width="10px">
                                <ClientSideEvents Click="function(s, e) {
	popupErrores.Hide();
}" />
                                <Image Url="~/Images/ok.png">
                                </Image>
                            </dx:ASPxButton>
                        
                        </td>
                        
                        </tr>
                        
                        
                        </table>




                 </dx:PanelContent>
    </PanelCollection>
   </dx:ASPxPanel>
   </dx:PopupControlContentControl>
</ContentCollection>
                </dx:ASPxPopupControl>
                 </ContentTemplate>
    </asp:UpdatePanel>
    

   
</asp:Content>
